package cc.spider.model;


import cc.spider.core.IFetcher;
import cc.spider.core.IDataPipe;
import cc.spider.core.IDataProcessor;

import java.io.Serializable;
import java.util.List;
import java.util.UUID;

public class TaskInfo implements Serializable {
    private IFetcher fetcher;
    private IDataProcessor processor;
    private List<IDataPipe> dataPipeList;
    /**
     * 优先级（只有使用优先级队列的情况下才有用
     */
    private int priority;
    /**
     * 唯一标识（只有使用了去重队列的情况下才有用），通过UUID自动生成
     */
    private String uuKey;

    public TaskInfo() {
        this.uuKey = UUID.randomUUID().toString();
    }

    public IFetcher getFetcher() {
        return fetcher;
    }

    public void setFetcher(IFetcher fetcher) {
        this.fetcher = fetcher;
    }

    public IDataProcessor getProcessor() {
        return processor;
    }

    public void setProcessor(IDataProcessor processor) {
        this.processor = processor;
    }

    public List<IDataPipe> getDataPipeList() {
        return dataPipeList;
    }

    public void setDataPipeList(List<IDataPipe> dataPipeList) {
        this.dataPipeList = dataPipeList;
    }

    public int getPriority() {
        return priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

    public String getUuKey() {
        return uuKey;
    }

    public void setUuKey(String uuKey) {
        this.uuKey = uuKey;
    }
}
